package com.chis.jxc;

import com.chis.jm.pojo.jxc.TdJxcStmtzx;
import com.chis.jmdatatimer.comm.TxMgmtModule;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class AddTz {
    public static void main(String[] args) {
        String std = args[0];
        String end = args[1];
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] {"spring.xml"});
        context.start();
        TxMgmtModule txMgmtModule = (TxMgmtModule) context.getBean("TxMgmtModule");
        List<TdJxcStmtzx> list = txMgmtModule.findNewTz(std,end);
        System.out.println(list.size());
        for(TdJxcStmtzx t :list){
            try {
                txMgmtModule.saveNewTz(t);
                System.out.println("成功："+t.getGuid());
            } catch (Exception e){
//                e.printStackTrace();
                System.out.println("失败："+t.getGuid());
            }

        }
        
    }
}
